﻿<Window x:Class="bd2wpf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib"
        Title="BD2WPF"  HorizontalAlignment="Left" VerticalAlignment="Bottom" MinWidth="0" MinHeight="0"   Name="MainWin" Icon="Image/contacts.png">
<!--Все иконки взяты с сайта www.iconsearch.ru и имеют лицензию GNU. Использованны иконки дизайнеров: 
    Alessandro Rei, Everaldo Coelho, Oliver Scholtz,Alexander Moore -->
    <Grid  Name="grid1"  HorizontalAlignment="Left" VerticalAlignment="Top" >
        <ProgressBar Height="26" HorizontalAlignment="Left" Margin="173,31,0,0" Name="progressBar" VerticalAlignment="Top" Width="74" IsIndeterminate="True" Visibility="Hidden" />
        <Menu  Margin="0,0,0,106">
            <MenuItem Header="_Файл">
                <MenuItem Header="_Подключить" Click="Connect_Click" />
                <MenuItem Header="_Сохранить" Name="SaveM" Click="Save_Click" IsEnabled="False"/>
                <MenuItem Header="_Отключить" Name="Disconnect" Click="Disconnect_Click" IsEnabled="False" />
                <MenuItem Header="_Выход" Click="Exit_Click" />
            </MenuItem>
            <MenuItem Header="_Правка">
                <MenuItem Header="_Выделить все" Command="SelectAll" />
                    <MenuItem Header="_Копировать" Command="Copy" />
                <MenuItem Header="_Поиск..." Name="SearchM" Click="Search_Click" IsEnabled="False" />
            </MenuItem>
            <MenuItem Header="_Справка">
                <MenuItem Header="_Помощь" Click="Help_Click"/>
                <MenuItem Header="О программе" Click="About_Click"/>
            </MenuItem>     
        </Menu>
        <DataGrid AutoGenerateColumns="False"  ItemsSource="{Binding MyClasses}"  Margin="0,105,0,0" Name="dataGrid1" SelectionUnit="FullRow" VerticalAlignment="Top" FlowDirection="LeftToRight" HorizontalContentAlignment="Right" 
                  VerticalContentAlignment="Bottom" CanUserDeleteRows="True" CanUserResizeRows="False" AreRowDetailsFrozen="False" HorizontalAlignment="Left" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="Фамилия" Binding="{Binding Path=LastName}"  />
                <DataGridTextColumn Header="Имя" Binding="{Binding Path=Name}"   />
                <DataGridTextColumn Header="Отчество"  Binding="{Binding Path=Patronymic}" />
                <DataGridTemplateColumn Header="Пол"  Width="40" CanUserSort="True" SortMemberPath="SexString">
                    <DataGridTemplateColumn.CellTemplate >
                        <DataTemplate>
                            <ComboBox Name="Пол" SelectedItem="{Binding Path=SexString,UpdateSourceTrigger=PropertyChanged}">
                                <ComboBox.ItemsSource>
                                    <coll:ArrayList>
                                        <sys:String>m</sys:String>
                                        <sys:String>w</sys:String>
                                    </coll:ArrayList>
                                </ComboBox.ItemsSource>
                            </ComboBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                
                <DataGridTextColumn Header="Моб.Тел" Binding="{Binding Path=Mobily}"   />
                <DataGridTextColumn Header="Раб.Тел" Binding="{Binding Path=Internal}"   />
                <DataGridTextColumn Header="E-mail" Binding="{Binding Path=EMail}"   />
                <DataGridTemplateColumn Header="Фото" Width="100" >
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate />
                    </DataGridTemplateColumn.CellEditingTemplate>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding Photo}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Город" Binding="{Binding Path=City}"   />
                <DataGridTextColumn Header="Улица" Binding="{Binding Path=Street}"   />
                <DataGridTextColumn Header="Дом" Binding="{Binding Path=Home}"   />
                <DataGridTextColumn Header="Квартира" Binding="{Binding Path=Flat}"   />
                <DataGridTextColumn Header="Должность" Binding="{Binding Path=Position}"   />
                <DataGridTextColumn Header="Подразделение" Binding="{Binding Path=Subdivision}"   />
                <DataGridTextColumn Header="Доп.Инф-я" Binding="{Binding Path=Info}"   />

            </DataGrid.Columns>
        </DataGrid>
        <Label Content="Фильтрация по" Height="28" HorizontalAlignment="Left" Margin="3,71,0,0" Name="label1" VerticalAlignment="Top" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="103,72,0,0" Name="FiltrCB" VerticalAlignment="Top" Width="113" >
            <ComboBoxItem Content="Фамилии" />
            <ComboBoxItem Content="Имени" />
            <ComboBoxItem Content="Отчеству" />
            <ComboBoxItem Content="Полу" />
            <ComboBoxItem Content="Моб.Тел." />
            <ComboBoxItem Content="Раб.Тел." />
            <ComboBoxItem Content="E-mail" />
            <ComboBoxItem Content="Городу" />
            <ComboBoxItem Content="Улице" />
            <ComboBoxItem Content="Должности" />
            <ComboBoxItem Content="Подразделению" />
        </ComboBox>
        <TextBox Height="23" HorizontalAlignment="Left" Margin="222,72,0,0" Name="textFiltr" VerticalAlignment="Top" Width="120" />
        <Button Content="Фильтрация" Height="23" HorizontalAlignment="Left" Margin="348,71,0,0" Name="Filtr" VerticalAlignment="Top"  Click="Filtr_Click" />
        <Button Content="Отмена Фильтрации" Height="23" Margin="426,72,0,0" Name="Cansel" VerticalAlignment="Top"  Click="Cansel_Click" HorizontalAlignment="Left" Width="118" />
        <ToolBar  HorizontalAlignment="Left" Margin="3,26,0,0" Name="toolBar1" VerticalAlignment="Top"  >
            <ItemsControl>
                <Button ToolTip="Сохранить"  Width="32"  HorizontalAlignment="Right"  Name="Save" VerticalAlignment="Top" IsEnabled="False" Click="Save_Click">
                    <Image Source="image/3floppy_mount.png"  />
                </Button>
            </ItemsControl>
            <ItemsControl>
                <Button ToolTip="Добавить"  Width="32" HorizontalAlignment="Right"  Name="Add" VerticalAlignment="Top" IsEnabled="False" Click="Add_Click">
                    <Image Source="image/add_group.png"  />              
                </Button>
            </ItemsControl>
            <ItemsControl>
                <Button ToolTip="Поиск"  Width="32" HorizontalAlignment="Right"  Name="SearchB" VerticalAlignment="Top" IsEnabled="False" Click="Search_Click">
                    <Image Source="image/Search_user.png"  />
                </Button>
            </ItemsControl>
            <ItemsControl>
                <Button ToolTip="Удалить строку"  Width="32" HorizontalAlignment="Right"  Name="Delete" VerticalAlignment="Top" IsEnabled="False" Click="Delete_Click">
                    <Image Source="image/remove.png"  />
                </Button>
            </ItemsControl>
        </ToolBar>
        
    </Grid>
</Window>
